package cn.xxd.common;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String APP_ID = "";

    // 商户私钥，您的PKCS8格式RSA2私钥，这些就是我们刚才设置的
    public static String MERCHANT_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCiru3q1k5zMNQN96rSnqM7WEZFK40iM2vB7mXggzD/C45bRfp9c99K1FxpE6zXFZ97um4umk9oNTx58tJNNdbfC202ShmBFgQpkiF+WKU5mLKfHOT7oa9opAoovdrvbFYbscLDXL8Bd/ktpTFr7wQ94Yy6b2YJEvNaYWwmwF5hMphJqVdlEB9gZFP02gjfzCoV5ToE5vjOaxcQC9nmAsgMHh7xucdpXx7bSKr/N4utiIEoeWC0RLUGkX0nLQ2pwksBZxvcYz9r16q35QTn8pc713YDqvhQrwhoGmTLFveIlQkKlu/StP9NUAXCZfwnsU33/icJE6eFs2og7et2ZsH9AgMBAAECggEAcuQvyoYHaXq2iBa9YXn/tc2l8vvK9Lh0BcYj1OdSFw1GQFevjCHlNKe9i8gFbPEsbOlBH1CDfAj86PMAat73HRaozoqOcIfn8KPvW5enOIIKxCxX2w5ZHwGa2yMaF7TfKzfjYK2Dh7n/FKlxudRXnoxIIvLBkO79Rns/Mi7xeJpuhWBzeNpQbozEvdEtzGzKANIVW2hY1BCYDqglIq9w2hSmlw5UMBqv08YpYykcd5sRH87FtoCFqy8PUvGu4HneuKAMXMcNsMAVmSM+WI0jWdNf6kTPz3RClHpRZXkFXvzlfWyghkDLbzA1XtoaMKzbLBi6++DxY5TYxjjYSGhtAQKBgQDOay1Z0YMFXgmfckWZn016dzCdcROBZ2UhYYZssiVyneEAvZ7F1pw9xWzxibDuFMvgT++fA7ZTzKoA9iWrHSsWGNGVNBPc5Q1LjffvakMZ9y5Ijy2jCIuoWFu7atcZDH+LtoHln8YirH//Km1MDnQM1egWH1jogBXdQznnVrtc0QKBgQDJwm+6nwBtqAOmZxGX/vh3e1QMm0XCVcfVhGU8pXKK2jJn963Tt+RaiLdvKJBUic42i4CAD+CXuEvTtD4LQcjKp2mrlAwoXOZB6KH5kj3nYciP8Xcxdguw5kdmwsy9oU56o3l5KIyqOqqy8msb32lkqNLV4c80QW1W6PpE2jetbQKBgQCZI6CQq0QF/l8rQM7sCuijO7wAgjyTW48GteDR0VTA9OpR71vUsMRXe5m4lIuEBj+/Ge7PTSS+hO93KSaHDWvCyATtKaa20eQMMrZHk9FWeTCIOlkERDnAWlUr9TbBaalSkMNMBT4syUdomiReMbbdMvEtQHJog2Y1MkPKIml8kQKBgDxP4mRwOYmOKyEoOGsubgoRlOt70xun1uft/vFlJ9t4JI9Ny+m5VAr4SZVyE8shssI9a3lcxa+1CP3NKKrmzGZAK2d+BzBdrPtQ1nKrk9PCOFlHPnFLr2z/OaLvYpLhUHt6uMpOI9aTWQnLS9d2LqRHj1cefHlLgar0VDQW44P1AoGBAKgZSZVX9Mo9h20i4ozyjJ2DxS0hwItQyrGkuWs3AVpE1TO9XjghXPZV8P4mWrrnlqEeF1d4zgM9E0vfHgtOUcIdagGYESu4I63qbFRg61pld9btob/LCtpmWJPwojagFuYbjHHJowBVnZoW1VCyYMZroTU6+s+aGx2VbzsnyOIc";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。，这些就是我们刚才设置的
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxNtlmt48QNFL9VboJhX8Gr1agP1C//muX6cm2ViOD7Hm7jpVHZxFQ+LhVyrKyWsp3UogQc9IY4D6CNPCuXsFVOfXDxI+5fGKjNuvtdAAtWrxQgzBh6a+yCy8VtvhFy08S4mJVOa8AMLmCYuLc8fXJdquNqVwZh1Gt+y/Njz4nZ02LRn/W985KrlqC0nRkOSsJ7PvsrCzi/Cy6/35NwDksVlSRR89D3YRWk0nW8EgE+vJ/nliQHyTv8cxCyyP7ZLT7IEDBJEZWGF5tMj/HQrchYGWnUDWrgZLNyj3V96zC1t3lIXRF8Y46isn7WMyzQTbYqzFV30drDvQNEADsmD+EwIDAQAB";

    //异步通知，再这里我们设计自己的后台代码，必须外网可以正常访问
    public static String notify_url = "http://b2944625b9.zicp.vip/notifyurl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数
    public static String return_url = "http://localhost:8083/user/getOrderReturn";

    // 签名方式
    public static String SIGN_TYPE = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 支付宝网关
    public static String GATEWAYURL = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String LOG_PATH = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(LOG_PATH + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
